<?php

namespace app\systems\controller;

use app\common\controller\DBase;
use app\common\controller\PCBase;
use  app\systems\logic\SystemMqLogic;
use  think\App;

class SystemsMq extends PCBase
{
    protected $systemMqLogic = null;
    public function __construct(App $app, SystemMqLogic $systemMqLogic)
    {
        parent::__construct($app);
        $this->systemMqLogic = $systemMqLogic;
    }

    /**
     * @desc 队列消息列表
     * @author xx
     * @Date 2024/3/12 12:36
     */
    public function index()
    {
        $params     = $this->request->post();
        $renderData = $this->systemMqLogic->page_list_service($params);
        return  $renderData;
    }


    /**
     * @desc 队列消息查找
     * @author xx
     * @Date 2024/3/12 12:36
     */
    public function find()
    {
        $params     = $this->request->post();
        $id         = $params['id']??'';
        $data       = $this->systemMqLogic->get_mq_group_by_id($id);
        return json(DefaultResponse(200, true, '获取成功', $data));
    }






    /**
     * 队列消息添加
     * @author xx
     * @Date 2024/3/12 12:36
     * @return bool
     */
    public function add()
    {
        $params     = $this->request->post();
        $renderData = $this->systemMqLogic->mq_group_add($params);
        return  $renderData;
    }

    /**
     * 队列消息编辑
     * @author xx
     * @Date 2024/3/12 12:36
     * @return bool
     */
    public function edit($id = null)
    {
        if ($this->request->isPost()) {
            $params     = $this->request->post();
            return $this->systemMqLogic->mq_group_edit($params);
        }
    }

    /**
     * 队列-审核
     * @author xx
     * @Date 2024/3/12 12:36
     * @return bool
     */
    public function confirmInfo()
    {
        $params     = $this->request->post();
        $renderData = $this->systemMqLogic->mq_group_status($params);
        return     $renderData;
    }
}
